package com.xingzuo.library_expert.adapter;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.xingzuo.base.ui.mvp.base.adapter.BaseAdapter;
import com.xingzuo.library_expert.R;
import com.xingzuo.library_expert.bean.MyAppontmentBean;

import java.util.List;

public class MyAppointmentAdapter extends BaseAdapter<MyAppontmentBean> {
    public MyAppointmentAdapter(int layoutResId, @Nullable List<MyAppontmentBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MyAppontmentBean item) {
        super.convert(helper, item);
        helper.setText(R.id.tv_date,item.getDate());
        RecyclerView recyclerView=helper.getView(R.id.rv_list);
        MyAppointChildAdapter appointChildAdapter=new MyAppointChildAdapter(R.layout.item_myreservation_list_child,item.getList());
        recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        recyclerView.setAdapter(appointChildAdapter);
    }
}